namespace Valil.Chess
{
  /// <summary>
  /// Implements the board status.
  /// </summary>
  public struct BoardStatus
  {
    private bool whiteTurn;
    private bool whiteCouldCastleShort;
    private bool whiteCouldCastleLong;
    private bool blackCouldCastleShort;
    private bool blackCouldCastleLong;
    private int? enPassantTarget;
    private int ply;
    private int moves;

    /// <summary>
    /// True if white is to move, false otherwise.
    /// </summary>
    public bool WhiteTurn
    {
      get { return whiteTurn; }
      set { whiteTurn = value; }
    }

    /// <summary>
    /// True if black is to move, false otherwise.
    /// </summary>
    public bool BlackTurn
    {
      get { return !whiteTurn; }
      set { whiteTurn = !value; }
    }

    /// <summary>
    /// White short castling availability.
    /// </summary>
    public bool WhiteCouldCastleShort
    {
      get { return whiteCouldCastleShort; }
      set { whiteCouldCastleShort = value; }
    }

    /// <summary>
    /// White long astling availability.
    /// </summary>
    public bool WhiteCouldCastleLong
    {
      get { return whiteCouldCastleLong; }
      set { whiteCouldCastleLong = value; }
    }

    /// <summary>
    /// Black short castling availability.
    /// </summary>
    public bool BlackCouldCastleShort
    {
      get { return blackCouldCastleShort; }
      set { blackCouldCastleShort = value; }
    }

    /// <summary>
    /// Black long castling availability.
    /// </summary>
    public bool BlackCouldCastleLong
    {
      get { return blackCouldCastleLong; }
      set { blackCouldCastleLong = value; }
    }

    /// <summary>
    /// The position of the en passant target.
    /// </summary>
    public int? EnPassantTarget
    {
      get { return enPassantTarget; }
      set { enPassantTarget = value; }
    }

    /// <summary>
    /// The ply.
    /// </summary>
    public int Ply
    {
      get { return ply; }
      set { ply = value; }
    }

    /// <summary>
    /// The move number.
    /// </summary>
    public int Moves
    {
      get { return moves; }
      set { moves = value; }
    }
  }
}